import axios from 'axios'

const service = axios.create({
  baseURL: 'http://localhost:3000',
  timeout: 80000
})
service.interceptors.request.use(
  (config) => {
    return config
  },
  (error) => {
    return Promise.reject(error)
  }
)

export default {
  get (url, params) {
    return service({
      method: 'get',
      url,
      params
    })
  },
  post (url, data) {
    return service({
      method: 'post',
      url,
      data
    })
  }
}
